//
//  ViewController.m
//  Homework1
//
//  Created by 王军 on 15/11/17.
//  Copyright © 2015年 wj. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    /*练习要求:
     新建一个工程,运行模拟器,获取该应用程序沙盒中的几个文件目录:Documents,tmp,Library/Caches,并打印在控制台,验证路径是否正确.*/
   //  获取沙盒文件目录(Documents)
    NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString * documentsDirectory = [paths objectAtIndex:0];
    
    NSLog(@"%@",documentsDirectory);
    
  //  获取tmp目录
    NSString * tmpDir = NSTemporaryDirectory();
    NSLog(@"%@",tmpDir);
    
 //  获取Library/Caches
    NSArray * pathss = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    
    NSString *path = [[pathss objectAtIndex:0] stringByAppendingPathComponent:@"Preferences"];
    NSLog(@"%@",path);
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
